import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/news/:id',
    name: 'news',
    component: () => import('@/components/news/news-index.vue'),
    props: true
  },
  {
    path: "/:pathMatch(.*)*",
    redirect: "/news/405"
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
